<template>
    <div class="video-list-item">
        <!--视频封面图片链接-->
        <router-link
            class="cover-img"
            :to="{path:`/ContentDisplay/VideoPlay/${videoData.id}`, query:{item:videoData.item}}"
        >
            <img :src="videoData.cover" alt=""/>
        </router-link>
        <div class="video-introduce-box">
            <router-link
                :to="{path:`/ContentDisplay/VideoPlay/${videoData.id}`, query:{item:videoData.item}}"
                class="video-introduce-title"
            >{{videoData.title || '--'}}</router-link>
            <div class="video-introduce-item">
                <span>发布时间：</span>
                <span>{{videoData.time.split(' ')[0] || '--'}}</span>
            </div>
            <div class="video-introduce-item">
                <span>简介：</span>
                <span>{{videoData.description || '--'}}</span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: "VideoItemComponent",
    props:{
        videoData:{
            type:Object
        },
        id:{
            type:String
        },
        index:{
            type:Number
        }
    },
    computed:{
        to(){
            return {
                path:'',
                query: {
                    item: this.index + 1
                }
            }
        }
    }
}
</script>

<style lang="less" scoped>
@import "../../../assets/global";
.video-list-item{
    .cover-img{
        display:inline-block;
        width:150px;
        height:90px;
        padding: 10px 10px 10px 10px;
        img{
            width:100%;
            height:100%;
            object-fit: contain;
        }
    }
    .video-introduce-box {
        vertical-align: bottom;
        display: inline-block;
        width: 220px;
        height: 90px;
        padding: 10px 10px 10px 10px;
        font-family: Microsoft YaHei UI;

        .video-introduce-title {
            font-size: 16px;
            font-weight: 400;
            color: #4E4E4E;
            .line-ellipsis(1);
            line-height: 30px;

            &:hover {
                color: #738AE7;
            }
        }
        .video-introduce-item {
            font-size: 10px;
            font-weight: 400;
            color: #777777;
            .line-ellipsis(2);
            line-height: 20px
        }
    }
}

/** pad版 */
@media (max-width: 992px) {
    .video-list-item{
        .cover-img{
            width:30vw;
            height:18vw;
        }
    }

    .video-introduce-box{
        width: 70vw!important;
        vertical-align: top!important;
    }
}
</style>